using System;

namespace NCommet.Core.Agents
{
    /// <summary>
    /// IDaoEventsSink notifies <see cref="IDaoEventsListener" /> about events originating
    /// from the underlying data access layer.
    /// </summary>
    public interface IDaoEventsSink
    {
        /// <summary>
        /// Registers a <see cref="NCommet.Core.Agents.IDaoEventsListener" />
        /// </summary>
        /// <param name="listener">The <see cref="NCommet.Core.Agents.IDaoEventsListener" /> that is registered.</param>
        void AddDaoEventsListener(IDaoEventsListener listener);

        /// <summary>
        /// Removes a <see cref="NCommet.Core.Agents.IDaoEventsListener" /> from the listeners.
        /// </summary>
        /// <param name="listener">The <see cref="NCommet.Core.Agents.IDaoEventsListener" /> that is removed.</param>
        void RemoveDaoEventsListener(IDaoEventsListener listener);

        /// <summary>
        /// When Enabled is <c>true</c> (the default) events are fired normally.
        /// When Enabled is <c>false</c> events are not fired.
        /// </summary>
        bool Enabled { get; set;}
    }
}